Skip to content

chore(seer): Use seer quotas endpoints #91937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2025
Merged

Conversation

roaga
Copy link
Member

@roaga roaga commented May 20, 2025

Records billable Seer events and checks for available budget before running Seer features. Will follow up with trial status + UI work.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 20, 2025
Comment on lines +41 to +44
group=group,
user=request.user,
force_event_id=force_event_id,
source=SeerAutomationSource.ISSUE_DETAILS,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switching to an enum for cleanliness

Copy link

codecov bot commented May 20, 2025

Codecov Report

Attention: Patch coverage is 87.17949% with 5 lines in your changes missing coverage. Please review.

⚠️ Parser warning

The parser emitted a warning. Please review your JUnit XML file:

Warning while parsing testcase attributes: Limit of string is 1000 chars, for name, we got 2083 at 1:156309 in /home/runner/work/sentry/sentry/.artifacts/pytest.junit.xml
Files with missing lines Patch % Lines
src/sentry/seer/issue_summary.py 80.00% 3 Missing ⚠️
src/sentry/seer/autofix.py 83.33% 1 Missing ⚠️
src/sentry/tasks/autofix.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #91937      +/-   ##
==========================================
+ Coverage   84.08%   87.87%   +3.79%     
==========================================
  Files       10170    10159      -11     
  Lines      582941   582614     -327     
  Branches    22603    22542      -61     
==========================================
+ Hits       490140   511977   +21837     
+ Misses      92348    70213   -22135     
+ Partials      453      424      -29     

@@ -134,5 +140,8 @@ def get(self, request: Request, group: Group) -> Response:
"orgHasAcknowledged": org_acknowledgement,
"userHasAcknowledged": user_acknowledgement,
},
"billing": {
"hasAutofixQuota": has_autofix_quota,
},
}
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to return billing and trial information in the setup check so we can display different things on the UI

@roaga roaga marked this pull request as ready for review May 22, 2025 04:58
@roaga roaga requested review from a team as code owners May 22, 2025 04:58
@@ -808,6 +816,11 @@ def trigger_autofix(

group.update(seer_autofix_last_triggered=timezone.now())

# log billing event for seer autofix
quotas.backend.record_seer_run(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if we set it up like this does it mean that we count a seer run for each time you press start on autofix, including:

  1. Hit start on a fresh issue without an autofix
  2. Hit start over then start on an issue with an autofix
  3. Automation that calls this method
    but not if say, you do a rethink from the very beginning of an Autofix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that's the intention

@roaga roaga merged commit e135c10 into master May 22, 2025
60 checks passed
@roaga roaga deleted the seer/use-billing-endpoints branch May 22, 2025 13:44
@roaga roaga added the Trigger: Revert Add to a merged PR to revert it (skips CI) label May 22, 2025
@getsentry-bot
Copy link
Contributor

PR reverted: 94d21bb

getsentry-bot added a commit that referenced this pull request May 22, 2025
This reverts commit e135c10.

Co-authored-by: roaga <47861399+roaga@users.noreply.github.com>
@roaga roaga restored the seer/use-billing-endpoints branch May 22, 2025 16:36
roaga added a commit that referenced this pull request May 22, 2025
This reverts commit e135c10.

Co-authored-by: roaga <47861399+roaga@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Trigger: Revert Add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants